class Solution {
public:
    int findKOr(vector<int>& nums, int k) {
        int ans = 0;
        vector<int>st(32);
        for (auto x : nums) {
            for (int i = 0; i < 31; i++) {
                if (x & (1 << i))st[i]++;
            }
        }
        for (int i = 0; i < 31; i++) {
            if (st[i] >= k)ans |= (1 << i);
        }
        return ans;
    }
};